var _dialogFirst = true;

function endDialog() {
	$('#dialog-overlay, #dialog-box').hide();
}

function popup() {
	if (_dialogFirst == true) {
		var temp_float = new String;
		temp_float = "<div id=\"dialog-overlay\"></div>";
		temp_float += "<div id=\"dialog-box\">";
		temp_float += "<div class=\"dialog-content\" style=\"background: #eee url('resources/img/loading-thickbox.gif') no-repeat 50% 50%\">";
		temp_float += "<iframe id='iframe' width='580' height='365' scrolling='no' frameborder='0'></iframe>";
		temp_float += "<a href=\"javascript:endDialog();\" class=\"button\">取消</a></div>";
		temp_float += "</div>";
		$("body").append(temp_float);
		_dialogFirst = false;
	}

	var maskHeight = $(document).height();
	var maskWidth = $(window).width();
	var dialogTop = 150;
	var dialogLeft = (maskWidth / 2) - ($('#dialog-box').width() / 2);
	
	$('#iframe').attr("src", "");

	$('#dialog-overlay').css({
		height : maskHeight,
		width : maskWidth
	}).show();
	$('#dialog-box').css({
		top : dialogTop,
		left : dialogLeft
	}).show();
}

function AuthSina(url) {
	$('#iframe').attr("src", url);
}
